Support ParameteryEntry as an argument#5
Conversation
|
I understand what you're saying with the difference between The closest I can get to an similar error, is for example by attempting to directly use an Note there's a distinction between a command's arguments and a command's entries:
A If I have misunderstood you, maybe you can adapt below example to illustrate the issue that you are seeing: import yamcs.pymdb as Y
system = Y.System("myproject")
ccsds_header = Y.ccsds.add_ccsds_header(system)
command_id = Y.IntegerArgument(
name="command_id",
signed=False,
encoding=Y.uint16_t,
)
base_command = Y.Command(
system=system,
name="Base",
abstract=True,
base=ccsds_header.tc_command,
assignments={
ccsds_header.tc_secondary_header.name: "Not Present",
ccsds_header.tc_apid.name: 101,
},
arguments=[
command_id,
],
)
arg = Y.IntegerArgument(
name="arg",
encoding=Y.uint16_t,
)
par = Y.IntegerParameter(
system=system,
name="par",
data_source=Y.DataSource.LOCAL,
encoding=Y.int32_t,
)
Y.Command(
system=system,
base=base_command,
name="SomeCommand",
assignments={command_id.name: 3},
arguments=[
arg,
# par, # Not allowed
],
entries=[
Y.ArgumentEntry(arg),
# Y.ParameterEntry(par), # Currently broken
],
)
print(system.dumps())
See option |
Oh I see, I was not aware of this intended meaning of ParameterEntry. I'll close this PR then, since it was made in error.
|
When attempting to use a ParameterEntry as an argument for a command, you will get this error:
This is because while arguments have 'default', ParameterEntry does not.
While it does instead have a 'initial_value' field, but it would be better to not assign a ParameterEntry's initial_value as the default argument since that would cause that argument to be hidden inside the default dropdown menu when trying to Send a Command in YAMCS.
This would help with not having to define the same field that appears in telemetry containers and commands twice -- once as a parameter and again as an argument.